<!--
 * @Description: 告警码穿梭框
 * @Author: 0001101008/HuYuxi
 * @Date: 2021-09-06 11:19:23
 * @LastEditTime: 2021-09-16 10:46:06
 * @LastEditors: 0001101008/HuYuxi
-->
<template>
  <el-dialog
    title="告警码"
    class="dialog-box"
    width="640px"
    :visible.sync="diagStatus"
    :close-on-click-modal="false"
    @close="cancle"
  >
    <div class="box-content">
      <kr-paging
        :dataList="dataList"
        :selectedData="selectedData"
        :pageSize="15"
        @onChange="onChange"
        filterable
        ref="krPage"
        :getPageData="getPageData"
      ></kr-paging>
    </div>
    <span slot="footer" class="dialog-footer">
      <el-button @click="cancle">{{$t('user.Cancel')}}</el-button>
      <el-button type="primary" @click="confirm">{{$t('user.Confirm')}}</el-button>
    </span>
  </el-dialog>
</template>

<script>
export default {
  props: ['diagStatus', 'dataList', 'selectedData'],
  data () {
    return {
      selectList: []
    };
  },
  methods: {
    // 取消
    cancle () {
      let _this = this;
      // _this.selectList = [];
      _this.$emit('closeAlarmCode', false);
    },
    // 确定
    confirm () {
      let _this = this;
      _this.$emit('getSelectData', JSON.stringify(_this.selectList));
    },
    onChange (val) {
      let _this = this;
      _this.selectList = val;
    },
  }
};
</script>